#ifndef _LIVEWIRE_H
#define _LIVEWIRE_H
#include "CImg.h"
#include "imgProcess.h"
using namespace cimg_library;
class LiveWire
{
public:
    LiveWire();
    ~LiveWire(){};

    bool GetPath(int x, int y);
    bool GetCost(CImg<unsigned char> src,CImg<double> *dst,float dWZ=0.2,float dWg =0.8);
    bool CalculatePathMap(CImg<double> cost, int x, int y, int radius = 50);

    bool GetIdealAnchor();
    bool isCalPath(){ return _isCalPath; };
    cimg_library::POINT *GetPathPoint(){ return pathPoint; }
    int GetPathLength(){ return _pathLength; }
private:
    CImg<double> _cost;
    CImg<int> iMapX;
    CImg<int> iMapY;
    CImg<int> iPX;
    CImg<int> iPY;
    CImg<int> iXX;
    CImg<int> iYY;
    CImg<int> iNX;
    CImg<int> iNY;
    CImg<bool> lE;
    cimg_library::POINT pathPoint[1000];
    int _pathLength;
    bool _isCalPath;




};
#endif //_LIVEWIRE_H